import alt from '../../app/alt'
import DialogActions from '../actions/dialog'

class DialogStore {

	constructor() {
		this.show = false;
		this.visible = false;
		this.bindActions(DialogActions);
	}

	onShow(param) {
        for(let i in param){
        	this[i]=param[i];
		}
		this.visible = true;
        setTimeout(() => {
            this.show = true;
            this.emitChange();
        }, 10)
	}

	onHide(){
		this.show = false;
		this.url = '';
        setTimeout(() => {
            this.visible = false;
            this.emitChange();
        }, 300)
	}
}

export default alt.createStore(DialogStore, 'DialogStore')
